@extends('layouts.head')




@section('content')

<div v-cloak id="content">
<el-row type="flex" :gutter="8" justify="start" >
<el-col style="width: 100px"  >
    <el-upload  action="{{asset('goods/inputPost')}}" name="inputGoods"  >
      <el-button size="small" type="primary">批量导入</el-button>
    </el-upload>
</el-col>  
<el-col  style="width: 400px">
    <el-button-group>
          <el-button @click="addGoodsV = true " type="primary"  size="small" >添加</el-button>
          <el-button @click="getNew"   size="small" >刷新</el-button>
          <el-button  @click="editRow()"  :disabled="!isCheckOne"  size="small">编辑</el-button>
          <el-button  @click="addOrder()"  :disabled="!isCheckOne"  type="primary"  size="small">后台下单</el-button>
          <!-- <el-button  @click="upRow()"  type="primary"   size="small">上架</el-button>
          <el-button  @click="downRow()"  type="primary"   size="small">下架</el-button> -->
          <el-button  @click="delRow()" type="danger" size="small">删除</el-button>
          
    </el-button-group> 
</el-col>
<el-col >    
    <el-button size="small" type=""  @click="yesterday" icon="arrow-left"></el-button>
    <el-date-picker v-model="date" style="width: 120px" size="small" type="date" placeholder="选择日期" > </el-date-picker>
    <el-button  size="small" type="" @click="tomorrow"  icon="arrow-right" ></el-button>
 </el-col>   
 </el-row>   
   <!--  <button class="mdui-btn btn-info mdui-btn-dense mdui-btn-raised " @click="getAll" >全部</button>
    <button class="mdui-btn btn-info mdui-btn-dense mdui-btn-raised " @click="getNew" >新商品</button>
    <button class="mdui-btn btn-info mdui-btn-dense mdui-btn-raised " @click="getUp" >已上架</button>
    <button class="mdui-btn btn-info mdui-btn-dense mdui-btn-raised " @click="getDown" >已下架</button> -->
<el-row>
         <el-table ref="multipleTable" :data="goods" border bordertooltip-effect="dark" border="true"  highlight-current-row
    @current-change="lookRow"   @selection-change="checkOne" style="width: 100%;font-size: xx-small;" >
            <el-table-column  type="selection" width="40">  </el-table-column>
            <el-table-column   type="index" width="40" > </el-table-column>
            <el-table-column    label="信息"  width="280">
                <template scope="scope">
                    <el-row :gutter="2">
                      <el-col :span="24"><div >品名：<a>@{{scope.row.name}}</a></div></el-col>
                    </el-row>
                    <el-row :gutter="2">
                      <el-col :span="12"><div ><img :src=" '{{$aliOssUrl}}/'+scope.row.img" class ="avatar "></div></el-col>
                      <el-col :span="12">
                        <el-row :gutter="2">
                          <el-col :span="24"><div>进价：<a>@{{scope.row.inPrice}}</a></div></el-col>
                        </el-row>
                        <el-row :gutter="2">
                         <el-row :gutter="2">
                          <el-col :span="24"> <div>标价：<a>@{{scope.row.price}}</a></div></el-col>
                        </el-row>
                          <el-col :span="24"><div>售价：<a>@{{scope.row.salePrice}}</a></div></el-col>
                        </el-row>
                        <el-row :gutter="2">
                          <el-col :span="24"> <div>库存：<a>@{{scope.row.count}}</a></div></el-col>
                        </el-row>
                      </el-col>
                    </el-row>
       
                </template>
            </el-table-column>
            <el-table-column  prop="brand" label="品牌" > </el-table-column>
            <el-table-column  prop="color" label="颜色" > </el-table-column>
            <el-table-column  prop="size" label="尺寸" > </el-table-column>
<!--             <el-table-column fixed="right"  label="操作"  width="120">
                <template scope="scope">
                  <el-button-group>
                     
                      <el-button  @click="editRow(scope.row.id, goods)" type="primary" icon=" " size="mini">编辑</el-button>
                      <el-button  @click="delRow(scope.row.id, goods)" type="danger" icon=" " size="mini">删除</el-button>
                  </el-button-group>     
                </template>
            </el-table-column> -->
        </el-table>
 </el-row>
<el-row>
        <el-pagination @size-change=""  @current-change="getgoodsCurrentPage" :current-page="goodsCurrentPage" :page-size="15" layout="total, prev, pager, next, jumper" :total="goodsCount">
        </el-pagination>
</el-row>


<el-dialog :visible.sync="addGoodsV" size="small"  title="添加商品" >
      <el-row :gutter="2">
          <el-col :span="4">品名</el-col>
          <el-col :span="8"><el-input v-model="addGoodsItem.name" size="small"  placeholder="请输入内容"></el-col>
          <el-col :span="4">品牌</el-col>
          <el-col :span="8"> 
              <el-select  v-model="addGoodsItem.brand"   size="small"   filterable  placeholder="选择品牌">
                  <el-option v-for="item in brand"  :key="item.name"   :label="item.name"  :value="item.name"></el-option>
              </el-select>
          </el-col>
      </el-row>
      <HR>
      <el-row :gutter="2">
          <el-col :span="4">进价</el-col>
          <el-col :span="8"> <el-input v-model="addGoodsItem.inPrice"  size="small" placeholder="请输入内容"></el-input></el-col>
          <el-col :span="4">售价</el-col>
          <el-col :span="8"> 
              <el-input v-model="addGoodsItem.salePrice"  size="small" placeholder="请输入内容"></el-input>
          </el-col>
      </el-row>
      <HR>
      <el-row :gutter="2">
          <el-col :span="4">标价</el-col>
          <el-col :span="8"><el-input v-model="addGoodsItem.price"  size="small" placeholder="请输入内容"></el-input></el-col>
          <el-col :span="4">库存</el-col>
          <el-col :span="8"> 
               <el-input v-model="addGoodsItem.count"   size="small" placeholder="请输入内容"></el-input>
          </el-col>
      </el-row>
      <HR>
      <el-row :gutter="2">
          <el-col :span="4">颜色</el-col>
          <el-col :span="8">
              <el-select  v-model="addGoodsItem.colors"  multiple size="small"   filterable allow-create  placeholder="选择颜色">
                  <el-option v-for="item in color"  :key="item.name"   :label="item.name"  :value="item.name"></el-option>
              </el-select>
          </el-col>
          <el-col :span="4">尺寸</el-col>
          <el-col :span="8"> 
               <el-select  v-model="addGoodsItem.sizes"  multiple size="small"   filterable  placeholder="选择尺寸">
                  <el-option v-for="item in size"  :key="item.name"   :label="item.name"  :value="item.name"></el-option>
              </el-select>
          </el-col>
      </el-row>
      <HR>
      <el-row :gutter="2">
          <el-col :span="4">图片</el-col>
          <el-col :span="20">
              <el-upload
                  ref="upload"
                  action="{{asset('img/post/')}}"
                  list-type="picture-card"
                  :auto-upload="false"
                  :file-list="fileList"
                  :on-success="imgUploadSuccess"
                  :on-preview="handlePictureCardPreview"
                  :on-remove="handleRemove"
                  :before-upload="beforeAvatarUpload">
                  <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
                  <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
              </el-upload>
              <el-dialog v-model="dialogVisible" size="tiny">
                 <img width="100%" :src="dialogImageUrl" alt="">
              </el-dialog>
          </el-col>
          
      </el-row>
      <HR>
      <span slot="footer" class="dialog-footer">
        <el-button @click="addGoodsV = false">取 消</el-button>
        <el-button type="primary" @click="submitAddGoods">确 定 </el-button>
      </span>
  
</el-dialog>



<el-dialog title="修改商品" :visible.sync="editGoodsV"   size="small"   >
      <el-row :gutter="2">
        <el-col :span="4">品名</el-col>
        <el-col :span="8"> <el-input v-model="editGoodsItem.name" size="small"  placeholder="请输入内容"></el-input> </el-col>
        <el-col :span="4">品牌</el-col>
        <el-col :span="8">
            <el-select  v-model="editGoodsItem.brand"   size="small"   filterable  placeholder="选择品牌">
                <el-option v-for="item in brand"  :key="item.name"   :label="item.name"  :value="item.name"></el-option>
            </el-select>
        </el-col>
      </el-row>
      <HR>
      <el-row :gutter="2">
        <el-col :span="4">标价</el-col>
        <el-col :span="8">  <el-input v-model="editGoodsItem.price"  size="small" placeholder="请输入内容"></el-input></el-col>
        <el-col :span="4">售价</el-col>
        <el-col :span="8">
             <el-input v-model="editGoodsItem.salePrice"  size="small" placeholder="请输入内容"></el-input>
        </el-col>
      </el-row>
      <HR>
      <el-row :gutter="2">
        <el-col :span="4">颜色</el-col>
        <el-col :span="8">
            <el-select  v-model="editColors"  multiple size="small"   filterable allow-create  placeholder="选择颜色">
                  <el-option v-for="item in color"  :key="item.name"   :label="item.name"  :value="item.name"></el-option>
              </el-select>
        </el-col>
        <el-col :span="4">尺寸</el-col>
        <el-col :span="8">
             <el-select  v-model="editSizes" multiple  size="small"   filterable  placeholder="选择尺寸">
                  <el-option v-for="item in size"  :key="item.name"   :label="item.name"  :value="item.name"></el-option>
              </el-select>
        </el-col>
      </el-row>
      <HR>
      <el-row :gutter="2">
        <el-col :span="4">老图片</el-col>
        <el-col :span="20">
            <el-row  :gutter="2">
              <el-col :span="8"><img :src=" '{{$aliOssUrl}}/'+editGoodsItem.img" class="avatar1 "></el-col>
              <el-col :span="8"><img :src=" '{{$aliOssUrl}}/'+editGoodsItem.img1" class="avatar1 "></el-col>
              <el-col :span="8"><img :src=" '{{$aliOssUrl}}/'+editGoodsItem.img2" class="avatar1 "></el-col>
            </el-row>
        </el-col>
      </el-row>
      <HR>
      <el-row :gutter="2">
          <el-col :span="4">新图片</el-col>
          <el-col :span="20">
              <el-upload
                  ref="upload"
                  action="{{asset('img/post/')}}"
                  list-type="picture-card"
                  :auto-upload="false"
                  :file-list="fileList"
                  :on-success="imgUploadSuccess"
                  :on-preview="handlePictureCardPreview"
                  :on-remove="handleRemove"
                  :before-upload="beforeAvatarUpload">
                  <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
                  <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>
              </el-upload>
              <el-dialog v-model="dialogVisible" size="tiny">
                 <img width="100%" :src="dialogImageUrl" alt="">
              </el-dialog>
          </el-col>
          
      </el-row>
      <HR>

  <span slot="footer" class="dialog-footer">
    <el-button @click="editGoodsV = false">取 消</el-button>
    <el-button type="primary" @click="submitEditGoods">确 定 </el-button>
  </span>
</el-dialog>


<el-dialog title="后台下单" :visible.sync="addOrderV"  size="small" >
       <el-row :gutter="2">
          <el-col :span="4">品名</el-col>
          <el-col :span="8"> @{{addOrderGoodsItem.name}} </el-col>
          <el-col :span="4">品牌</el-col>
          <el-col :span="8"> @{{addOrderGoodsItem.brand}}  </el-col>
        </el-row>
        <HR>
        <el-row :gutter="2">
          <el-col :span="4">标价</el-col>
          <el-col :span="8"> @{{addOrderGoodsItem.price}} </el-col>
          <el-col :span="4">进价</el-col>
          <el-col :span="8"> @{{addOrderGoodsItem.inPrice}}  </el-col>
        </el-row>
        <HR>
        <el-row :gutter="2">
          <el-col :span="4">客户</el-col>
          <el-col :span="8">
              <el-select  v-model="addOrderItem.clientId"   size="small"   filterable  placeholder="客户">
                  <el-option v-for="item in clients"  :key="item.id"   :label="item.name"  :value="item.id"></el-option>
              </el-select>
          </el-col>
          <el-col :span="4">数量(@{{addOrderGoodsItem.count}})</el-col>
          <el-col :span="8"><el-input-number v-model="addOrderItem.count" size="small" :min="1" :max="addOrderGoodsItem.count" ></el-input-number></el-col>
        </el-row>
        <HR>
        <el-row :gutter="2">
          <el-col :span="4">颜色</el-col>
          <el-col :span="8">
              <el-select  v-model="addOrderGoodsItem.color"   size="small"   filterable allow-create  placeholder="选择颜色">
                  <el-option v-for="item in goodsColors"  :key="item.color"   :label="item.color"  :value="item.color"></el-option>
              </el-select>
          </el-col>
          <el-col :span="4">尺寸</el-col>
          <el-col :span="8">
              <el-select  v-model="addOrderGoodsItem.size"   size="small"   filterable  placeholder="选择尺寸">
                  <el-option v-for="item in goodsSizes"  :key="item.size"   :label="item.size"  :value="item.size"></el-option>
              </el-select>
          </el-col>
        </el-row>
        <HR>
        <el-row :gutter="2">
          <el-col :span="4">折扣</el-col>
          <el-col :span="8"><el-input-number v-model="addOrderItem.discount" size="small" :min="0.5" :max="1" step="0.01" value="addOrderGoodsItem.discount" ></el-input-number>
              
          </el-col>
          <el-col :span="4">售价</el-col>
          <el-col :span="8"><el-input v-model="addOrderGoodsItem.salePrice" style="width: 120px;"  size="small" placeholder="请输入内容"></el-input></el-col>
        </el-row>
        <HR>
        <el-row :gutter="2">
          <el-col :span="4">支付</el-col>
          <el-col :span="8">
              <el-radio-group  size="small"  v-model="addOrderItem.costType">
                <el-radio-button size="small"  label="线下支付"></el-radio-button>
                <el-radio-button  size="small" label="余额支付"></el-radio-button>
              </el-radio-group>
          </el-col>
          <el-col :span="4">预付</el-col>
          <el-col :span="8"><el-input-number  :min="0" :step="1"  size="small"  v-model="addOrderItem.imprest"></el-input-number></el-col>
        </el-row>
        <HR>
        <el-row :gutter="2">
          <el-col :span="4">流程</el-col>
          <el-col :span="8">
              <el-radio-group  size="small"  v-model="orderFlow">
                <el-radio-button size="small"  label="订货"></el-radio-button>
                <el-radio-button  size="small" label="现货"></el-radio-button>
              </el-radio-group>
          </el-col>
          <el-col :span="4"> </el-col>
          <el-col :span="8"> </el-col>
        </el-row>
        <HR>
        <el-row :gutter="2">
          <el-col :span="4">图片</el-col>
          <el-col :span="20">
            <el-row  :gutter="2">
              <el-col :span="8"><img :src="'{{$aliOssUrl}}/'+ addOrderGoodsItem.img" class="avatar1 "></el-col>
              <el-col :span="8"><img :src="'{{$aliOssUrl}}/'+ addOrderGoodsItem.img1" class="avatar1 "></el-col>
              <el-col :span="8"><img :src="'{{$aliOssUrl}}/'+ addOrderGoodsItem.img2" class="avatar1 "></el-col>
            </el-row>
          </el-col>
        </el-row>
        <HR>
  <span slot="footer" class="dialog-footer">
    <el-button @click="addOrderV = false">取 消</el-button>
    <el-button type="primary" @click="submitAddOrder">确 定 </el-button>
  </span>
</el-dialog>

</div>
<script >
    var content =new Vue({
        el:'#content',
        data:{
            date:'<?php echo date('Y-m-d') ?>',
            company:'{{ Auth::user()->company }}',
            addGoodsV:false,
            editGoodsV:false,
            addOrderV:false,
            clients:[],
            goods:[],
            color:[],
            size:[],
            goodsColors:[],
            goodsSizes:[],
            editColors:[],
            editSizes:[],
            goodsPics:[],
            brand:[],
            goodsChrildren:[],
            goodsCount:1,
            goodsCurrentPage:1,
            type:0,
            addGoodsItem:{_token:'',name:'',company:'{{ Auth::user()->company }}',brand:'',price:'',inPrice:'',salePrice:'',discount:'',colors:[],sizes:[],img:'',count:''},
            editGoodsItem:{_token:'',name:'',brand:'',price:'',salePrice:'',discount:'',colors:[],sizes:[],img:''},
            addOrderItem:{type:'2',clientId:'',clientName:'',sellId:'{{ Auth::user()->id }}',sellName:'{{ Auth::user()->name}}',ordererId:'{{ Auth::user()->id }}',ordererName:'{{ Auth::user()->name}}',company:'{{ Auth::user()->company }}',count:1,costType:'',discount:'',imprest:0.00,},
            addOrderGoodsItem:[],
            multipleSelection: [],
            imgUrl:'',
            allUploadImg:[],
            fileList:[],
            dialogImageUrl: '',
            dialogVisible: false,
            orderFlow:'现货',
        },
        created:function(){
            this.$http.get('/goods/getCurrent/'+this.goodsCurrentPage+'/'+this.company).then((response) => {this.goods=response.data; console.log(response.data)},(response) =>{ }); 
            this.$http.get('/goods/getCount/'+this.company).then((response) => {this.goodsCount=response.data; console.log(response.data)},(response) =>{ }); 
            this.$http.get('/brand/getAll/'+this.company).then((response) => {this.brand=response.data; console.log(response.data)},(response) =>{ });
            this.$http.get('/color/getAll/'+this.company).then((response) => {this.color=response.data; console.log(response.data)},(response) =>{ });    
            this.$http.get('/size/getAll/'+this.company).then((response) => {this.size=response.data; console.log(response.data)},(response) =>{ });
            this.$http.get('/client/getAll/'+this.company).then((response) => {this.clients=response.data; console.log(response.data)},(response) =>{ });                     

        },
        computed: {
              isCheckOne:function(){
                if( this.multipleSelection.length == 1 ){
                  return true;
                }else{
                  return false;
                }
              }
        },
        methods:{
              ddd:function(val){
                  console.log(val);
              },
              submitUpload() {
                this.$refs.upload.submit();

              },
              imgUploadSuccess(res, file) {
                      this.imgUrl=res;
                      this.allUploadImg.push( this.imgUrl);
                       console.log(this.allUploadImg);
                      this.addOrderGoodsItem.img=res;
                    },
              editGoodsImg(res, file) {
                      this.imgUrl=res
                      this.editGoodsItem.img=res
                    },
             handleRemove(file, fileList) {
                console.log(file, fileList);
                console.log(this.allUploadImg)
              },
              handlePictureCardPreview(file) {
                this.dialogImageUrl = file.url;
                this.dialogVisible = true;
              },
              beforeAvatarUpload(file) {
                      const isJPG = file.type === 'image/jpeg';
                      const isLt2M = file.size / 1024 / 1024 < 2;

                      if (!isJPG) {
                        this.$message.error('上传头像图片只能是 JPG 格式!');
                      }
                      if (!isLt2M) {
                        this.$message.error('上传头像图片大小不能超过 2MB!');
                      }
                      return isJPG && isLt2M;
                    },
              beforeInputPost(file){
                      const isxls = file.type === 'application/msexcel';
                      const isLt2M = file.size / 1024 / 1024 < 2;

                      if (!isxls) {
                        this.$message.error('上传文件只能是excel');
                      }
                      if (!isLt2M) {
                        this.$message.error('上传头像图片大小不能超过 2MB!');
                      }
                      return isxls && isLt2M;
                    },
              getNew:function(){
                 
                  this.$http.get('/goods/getCurrent/'+this.goodsCurrentPage+'/'+this.company).then((response) => {this.goods=response.data; console.log(response.data)},(response) =>{ }); 
                  this.$http.get('/goods/getCount/'+this.company).then((response) => {this.goodsCount=response.data; console.log(response.data)},(response) =>{ });       
                  this.$http.get('/rules/getAll').then((response) => {this.rules=response.data; console.log('rules,success')},(response) =>{ });

              },
              getAll:function(){
                
                  this.$http.get('/goods/getCurrent/'+this.goodsCurrentPage+'/'+this.company).then((response) => {this.goods=response.data; console.log(response.data)},(response) =>{ }); 
                  this.$http.get('/goods/getCount/'+this.company).then((response) => {this.goodsCount=response.data; console.log(response.data)},(response) =>{ });       

                  this.$http.get('/rules/getAll').then((response) => {this.rules=response.data; console.log('rules,success')},(response) =>{ });

              },
              getUp:function(){
                 
                  this.$http.get('/goods/getCurrent/'+this.goodsCurrentPage+'/'+this.company).then((response) => {this.goods=response.data; console.log(response.data)},(response) =>{ }); 
                  this.$http.get('/goods/getCount/'+this.company).then((response) => {this.goodsCount=response.data; console.log(response.data)},(response) =>{ });       

                  this.$http.get('/rules/getAll').then((response) => {this.rules=response.data; console.log('rules,success')},(response) =>{ });

              },
              getDown:function(){
                 
                  this.$http.get('/goods/getCurrent/'+this.goodsCurrentPage+'/'+this.company).then((response) => {this.goods=response.data; console.log(response.data)},(response) =>{ }); 
                  this.$http.get('/goods/getCount/'+this.company).then((response) => {this.goodsCount=response.data; console.log(response.data)},(response) =>{ });       

                  this.$http.get('/rules/getAll').then((response) => {this.rules=response.data; console.log('rules,success')},(response) =>{ });

              },
              
              search:function(){
                  console.log(this.searchWord);
                  this.$http.get('/goods/search/'+this.searchWord).then((response) => {this.goods=response.data; this.goodsCount = this.goods.length;console.log('word,goods,success')},(response) =>{ console.log(response);}); 
                  
              } ,
              yesterday:function(){
                  console.log('yesterday');
              },
              tomorrow:function(){
                  console.log('tomorrow');
              },
              submitAddGoods:function(){
                  console.log('submitAddGoods');
                  this.addGoodsV = false;
               
                  this.$http.post('/goods/add',{_token:'{{csrf_token()}}',goods:this.addGoodsItem,allUploadImg:this.allUploadImg}).then((response)=>{this.$notify.success('添加成功');
                              this.$http.get('/goods/getCurrent/'+this.goodsCurrentPage+'/'+this.company).then((response) => {this.goods=response.data; console.log(response.data)},(response) =>{ }); 
                              this.$http.get('/goods/getCount/'+this.company).then((response) => {this.goodsCount=response.data; console.log(response.data)},(response) =>{ });   
                              this.allUploadImg=[];
                              this.fileList=[];     

                        },(response) =>{ this.$notify.error('未知错误')});

              },
              submitEditGoods:function(){
                  console.log('submitEditGoods');
                  this.editGoodsV = false;
                  this.editGoodsItem._token = '{{csrf_token()}}';
                  this.$http.post('/goods/update/'+this.editGoodsItem.id,{_token:'{{csrf_token()}}',goods:this.editGoodsItem,allUploadImg:this.allUploadImg,colors:this.editColors,sizes:this.editSizes}).then((response)=>{this.$notify.info(response.data);
                              this.$http.get('/goods/getCurrent/'+this.goodsCurrentPage+'/'+this.company).then((response) => {this.goods=response.data; console.log(response.data)},(response) =>{ }); 
                              this.$http.get('/goods/getCount/'+this.company).then((response) => {this.goodsCount=response.data; console.log(response.data)},(response) =>{ });
                              this.allUploadImg=[];
                              this.fileList=[];             

                        },(response) =>{  this.$notify.error('未知错误')  });
              },

              cancelAddGoods:function(){
                  console.log('cancelAddGoods');
              },
              submitAddOrder:function(){
                  console.log('submitAddGoods');
                  console.log(this.addOrderItem);
                  console.log(this.addOrderGoodsItem);
                  this.addOrderV = false;
                  this.$http.post('/order/add',{_token : '{{csrf_token()}}',order:this.addOrderItem,goods:this.addOrderGoodsItem,orderFlow:this.orderFlow}).then((response)=>{this.$notify.success('添加成功');
                        },(response) =>{ this.$notify.error('未知错误')});
              },
              lookRow:function(val){
                  console.log(val);
              },
              editRow:function(){
                  this.editGoodsItem=this.multipleSelection[0];
                  this.editGoodsV=true;
              },  
              addOrder:function(){
                 this.addOrderV=true;
                 this.addOrderGoodsItem=this.multipleSelection[0];
                 this.addOrderGoodsItem.color='';
                 this.addOrderGoodsItem.size='';
                 this.$http.get('/goods/getColors/'+this.addOrderGoodsItem.id).then((response) => {this.goodsColors=response.data; console.log(response.data)},(response) =>{ }); 
                 this.$http.get('/goods/getSizes/'+this.addOrderGoodsItem.id).then((response) => {this.goodsSizes=response.data; console.log(response.data)},(response) =>{ }); 
                  console.log(this.addOrderItem);
              },
              delRow:function(val){
                  console.log(val);
                  this.$http.post('/goods/del',{_token:'{{csrf_token()}}',date:this.multipleSelection}).then((response) => {this.$notify.info(response.data);
                                this.$http.get('/goods/getCurrent/'+this.goodsCurrentPage+'/'+this.company).then((response) => {this.goods=response.data; console.log(response.data)},(response) =>{ }); 
                                this.$http.get('/goods/getCount/'+this.company).then((response) => {this.goodsCount=response.data; console.log(response.data)},(response) =>{ });       

                          },(response) =>{ }); 

              },
              getgoodsCurrentPage:function(val){
                  console.log(val);
                  this.goodsCurrentPage=val;
                  this.$http.get('/goods/getCurrent/'+this.goodsCurrentPage+'/'+this.company).then((response) => {this.goods=response.data; console.log(response.data)},(response) =>{ }); 
                  this.$http.get('/goods/getCount/'+this.company).then((response) => {this.goodsCount=response.data; console.log(response.data)},(response) =>{ });       
              },
            
              checkChange:function(rows){
                     if (rows) {
                        rows.forEach(row => {
                          this.$refs.multipleTable.toggleRowSelection(row);
                        });
                      } else {
                        this.$refs.multipleTable.clearSelection();
                      }
              }, 
              checkOne:function (val) {
                console.log('11');
                console.log(val);
                this.multipleSelection = val;
              } ,
         },

  });
</script>




@endsection

@section('pagejs')

@endsection

        




